package movee.resilience4j;

import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 *
 * @author movee
 */
@Slf4j
@Service
public class ExamService {

    @CircuitBreaker(name = "backendA", fallbackMethod = "fallbackA")
    public void call() throws IOException {
        throw new IOException("hhhhh");
    }

    private void fallbackA(IOException e) {
        log.info("do fallback");
    }

}
